feat: Also support running a REST proxy#14
Merged
Conversation
e176a3f to
c3fc999
Compare
add4285 to
54c9b58
Compare
Add REST API proxy servers that expose service-gator functionality via HTTP. Each forge runs on its own port to avoid route collisions (e.g., GitHub and Forgejo both use /repos/*): --github-port PORT GitHub (/api/v3/* + bare paths for gh CLI) --gitlab-port PORT GitLab (/api/v4/*) --forgejo-port PORT Forgejo (/api/v1/*) --jira-port PORT JIRA (/rest/api/2/* + /rest/api/*) --rest-server ADDR Convenience: all four on consecutive ports Each server carries its ForgeKind and ApiService directly, so request handling is a simple prefix strip + delegate -- no runtime route-matching registry needed. JIRA search requires explicit -p/--project parameters instead of heuristic JQL parsing for authorization. Projects are validated against scope permissions, then a project filter is prepended to the JQL. This separates authorization data from the query language entirely. Permission errors use a thiserror-based ServiceError enum so that map_error_to_status_code and tests can match on typed variants instead of inspecting error message strings. Assisted-by: OpenCode (Claude claude-opus-4-6)
54c9b58 to
9869c61
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's really convenient and understandable for agents if they can run the
ghCLI directly. We can enable this by setting proxy variables.Implement this for gitlab and forgejo as well.